Installation
npm install --save @types/react-helmet
Summary
This package contains type definitions for react-helmet (https://github.com/nfl/react-helmet).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-helmet/v5.
import * as React from "react";
interface OtherElementAttributes {
[key: string]: string | number | boolean | null | undefined;
}
type HtmlProps = React.JSX.IntrinsicElements["html"] & OtherElementAttributes;
type BodyProps = React.JSX.IntrinsicElements["body"] & OtherElementAttributes;
type LinkProps = React.JSX.IntrinsicElements["link"];
type MetaProps = React.JSX.IntrinsicElements["meta"];
export interface HelmetTags {
baseTag: any[];
linkTags: HTMLLinkElement[];
metaTags: HTMLMetaElement[];
noscriptTags: any[];
scriptTags: HTMLScriptElement[];
styleTags: HTMLStyleElement[];
}
export interface HelmetProps {
async?: boolean | undefined;
base?: any;
bodyAttributes?: BodyProps | undefined;
children?: React.ReactNode;
defaultTitle?: string | undefined;
defer?: boolean | undefined;
encodeSpecialCharacters?: boolean | undefined;
htmlAttributes?: HtmlProps | undefined;
onChangeClientState?: ((newState: any, addedTags: HelmetTags, removedTags: HelmetTags) => void) | undefined;
link?: LinkProps[] | undefined;
meta?: MetaProps[] | undefined;
noscript?: any[] | undefined;
script?: any[] | undefined;
style?: any[] | undefined;
title?: string | undefined;
titleAttributes?: object | undefined;
titleTemplate?: string | undefined;
}
export class Helmet extends React.Component<HelmetProps> {
static peek(): HelmetData;
static rewind(): HelmetData;
static renderStatic(): HelmetData;
static canUseDOM: boolean;
}
export interface HelmetData {
base: HelmetDatum;
bodyAttributes: HelmetHTMLBodyDatum;
htmlAttributes: HelmetHTMLElementDatum;
link: HelmetDatum;
meta: HelmetDatum;
noscript: HelmetDatum;
script: HelmetDatum;
style: HelmetDatum;
title: HelmetDatum;
titleAttributes: HelmetDatum;
}
export interface HelmetDatum {
toString(): string;
toComponent(): React.ReactElement;
}
export interface HelmetHTMLBodyDatum {
toString(): string;
toComponent(): React.HTMLAttributes<HTMLBodyElement>;
}
export interface HelmetHTMLElementDatum {
toString(): string;
toComponent(): React.HTMLAttributes<HTMLHtmlElement>;
}
export const peek: () => HelmetData;
export const rewind: () => HelmetData;
export const renderStatic: () => HelmetData;
export const canUseDOM: boolean;
export default Helmet;
Additional Details
- Last updated: Thu, 21 Dec 2023 21:35:36 GMT
- Dependencies: @types/react
Credits
These definitions were written by Evan Bremer, Isman Usoh, Yui T., Yamagishi Kazutoshi, and Justin Hall.